#include <iostream>
#include <stdio.h>
using namespace std;

class A
{
	friend class B;
public:
	void prt()
	{
		printf("a %d\n",a);
	}
	
private:
	int a;
};

class B{
public:
	void set(int i)
	{
		aa.a=i;
	}
	void prt()
	{
		aa.prt();
	}
private:
	A aa;

};
int main()
{
	B bb;
	bb.set(520);
	bb.prt();

	return 0;
}
